package com.example.rabbitmqproducer.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@RabbitListener(queues = "hello")
public class RabbitmqReceiver {

    @Resource
    private AmqpTemplate rabbitTemplate;

    @RabbitHandler
    public void process(String hello) {
        System.out.println("receiver:" + hello);
    }
}
